package com.walker.controller.catalogue;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.walker.anno.ResponseResult;
import com.walker.service.catalogue.CatalogueDataSourceService;

import net.sf.json.JSONObject;

/**
 * 资产-目录-数据源
 */
@RestController
@RequestMapping(value = "/catalogueDataSource")
@ResponseResult
public class CatalogueDataSourceController {

	@Resource
	private CatalogueDataSourceService service;
	
	/**
	 * 数据源列表
	 * @param request
	 * @return
	 */
	@SuppressWarnings("unchecked")
	@PostMapping("queryDataSourceList")
	public Map<String, Object> queryDataSourceList(@RequestBody String request) {
		Map<String, Object> params = JSONObject.fromObject(request);
		return service.queryDataSourceList(params);
	}
	
	/**
	 * 数据源明细信息
	 * @param id
	 * @return
	 */
	@PostMapping("queryDataSourceDetail")
	public Map<String, Object> queryDataSourceDetail(@RequestBody String id) {
		return service.queryDataSourceDetail(id);
	}
	
	/**
	 * 数据源存储类型
	 * @return
	 */
	@PostMapping("getDataSourceType")
	public List<Map<String, Object>> getDataSourceType() {
		return service.getDataSourceType();
	}
	
}